package com.bandit.controller.front;

import com.bandit.pojo.MajorInfo;
import com.bandit.service.MajorInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/front")
public class MajorFrontController {

    private static final String prefix = "front";

    @Autowired
    MajorInfoService majorInfoService;

    @GetMapping("/major/list")
    public String toList(Model model){
        List<MajorInfo> majorInfoList = majorInfoService.selectMajorInfoList(new MajorInfo());
        model.addAttribute("majorInfoList",majorInfoList);
        return prefix + "/major";
    }

}
